using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Logging;
using Modes.Extend;
using Service.Implement;
using Service.Interface;

namespace Stall.Service
{
    public class Program
    {
        public static void Main(string[] args)
        {
            CreateHostBuilder(args).Build().Run();
        }

        public static IHostBuilder CreateHostBuilder(string[] args) =>
            Host.CreateDefaultBuilder(args)
            .UseWindowsService()
             .ConfigureServices((hostContext, services) =>
             {
                 services.AddTransient<IDbContextFactory, DbContextFactory>();
                 services.AddTransient<IStallService, StallService>();
                 services.AddTransient<ITenantStallRelationService, TenantStallRelationService>();
                 services.AddHostedService<Worker>();
             });
    }
}
